package com.glsc.ngateway.common.base.domainmapper;

import com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow.FlowFormSystemNameApply;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.system.domainDto.FlowFormSystemNameApplyDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * @Author: xuchang
 * @Desc: domin到dto转换
 */

/**
 * @Mapper自动生成接口实现类，完成domin与dto转换，componentModel=spring：规定实现类的组件类型，自动在实现类上加@Components注解，可以通过@Autowired引入实现类
 */
@Mapper(componentModel = "spring")
public interface FlowFormSystemNameApplyMapper {

    FlowFormSystemNameApplyMapper INSTANCE = Mappers.getMapper(FlowFormSystemNameApplyMapper.class);

    @Mapping(target = "businessDepartment", ignore = true)
    @Mapping(target = "opGroupId", ignore = true)
    @Mapping(target = "memberManager", ignore = true)
    @Mapping(target = "systemManager", ignore = true)
    @Mapping(target = "opsManager", ignore = true)
    @Mapping(target = "appendicesFileList", ignore = true)
    @Mapping(target = "businessDepartmentName", ignore = true)
    @Mapping(target = "belongDeptName", ignore = true)
    @Mapping(target = "opGroupName", ignore = true)
    @Mapping(target = "memberManagerName", ignore = true)
    @Mapping(target = "systemManagerName", ignore = true)
    @Mapping(target = "opsManagerName", ignore = true)
    FlowFormSystemNameApplyDto domain2dto(FlowFormSystemNameApply domain);


    List<FlowFormSystemNameApplyDto> domain2dto(List<FlowFormSystemNameApply> domain);

    @Mapping(target = "businessDepartmentArr", ignore = true)
    @Mapping(target = "opGroupIdArr", ignore = true)
    @Mapping(target = "memberManagerArr", ignore = true)
    @Mapping(target = "systemManagerArr", ignore = true)
    @Mapping(target = "opsManagerArr", ignore = true)
    @Mapping(target = "appendicesFileIdList", ignore = true)
    @Mapping(target = "insertTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "deleted", ignore = true)
    FlowFormSystemNameApply dto2domain(FlowFormSystemNameApplyDto dto);

    List<FlowFormSystemNameApply> dto2domain(List<FlowFormSystemNameApplyDto> dto);
}
